package net.zjitc.stack;

public class MyArraysStack<T> implements MyStack<T> {
    private int size = 0;
    private Object[] arr = new Object[10];
    @Override
    public boolean isEmpty() {
        return size==0?true:false;
    }

    @Override
    public T peek() {
        return (T) arr[size-1];
    }

    @Override
    public T pop() {
        return (T) arr[--size];
    }

    @Override
    public void push(T e) {
      arr[size++] = e;
    }
}
